package de.jmda.core.util.fileset;

import java.io.File;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Accepts existing directories only.
 */
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class FileFilterDirectoriesOnly extends FileFilterBase
{
	public boolean accept(File directory)
	{
		if (directory.exists() && directory.isDirectory())
		{
			return true;
		}
		return false;
	}

	@Override
  public String getDescription()
  {
	  return "directories only";
  }
}